import Vue from 'vue'

import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/zh-CN' // lang i18n
import '@/styles/index.scss' // global css
import App from './App'
import store from './store'
import router from './router'
import './utils/btnPermissions.js';
import './utils/loading.js';
import '@/icons' // icon
import api from "./utils/api"
import './assets/css/global.css'
import '@/permission' // permission control
import {
  setCookie,
  getCookie,
  delCookie
} from './utils/cookie.js'
Vue.prototype.$api = api
Vue.prototype.$cookieStore = {
  setCookie,
  getCookie,
  delCookie
}
import Moment from 'moment'
Vue.prototype.$moment = Moment;
// console.log(process.env.VUE_APP_BASE_API)
Vue.prototype.$uploadUrl = `${process.env.VUE_APP_BASE_API}/file/upload`
Vue.prototype.$uploadRaw = `${process.env.VUE_APP_BASE_API}/ingredient/import/batch`

import {
  uploadImg
} from "./utils/common"
Vue.prototype.$uploadImg = uploadImg;
Vue.filter('formatDate', function (value) {
  return Moment(value).format('YYYY-MM-DD HH:mm:ss')
})
Vue.filter('formatDate1', function (value) {
  return Moment(value).format('YYYY-MM-DD')
})
import clickForbidden from "./utils/clickForbidden"
Vue.directive('clickForbidden', clickForbidden);
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)

Vue.config.productionTip = false

new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
